/**
 * @author Created by qiush on 2017-06-09.
 */

const {BrowserWindow} = require('electron');
const mainWindowId = require('../mainWindowId');

const webContentUtil = {

  /**
   *
   * @returns {BrowserWindow}
   */
  getMainWindow() {
    return BrowserWindow.fromId(mainWindowId);
  },

  /**
   *
   * @returns {Electron.WebContents}
   */
  getMainWebContent() {
    const mainWindow = this.getMainWindow();
    return mainWindow.webContents;
  }
};

module.exports = webContentUtil;
